import {
    formInput,
} from '@/css/DialogsCss.module.scss';
export default {
    title:'新增标签',
    dialog:{
        width: 600,
        type:'dialog',
    },
    // onMounted:[{
    //     action: 'set',
    //     target: '$widgets.form',
    //     field: 'value',
    //     value: '$params'
    // }],
    onMounted: [{
        action:'print',
        value:'$params'
    },{
        action:'set',
        target: '$view',
        field:'title',
        value:'$params.title'
    },{
        action: 'set',
        target: '$widgets.form',
        field: 'value',
        value: '$params.form'
    }],
    items:[{
        region: 'center',
        layout:'vertical',
        items:[{
            id: 'form',
            widget: 'form',
            fields:[{
                class: formInput,
                itemId: 'value',
                placeholder:'请输入标签',
                widget:'text',
                label:'标签名称',
            },{
                value: '#ff0000',
                widget:'form-colorpicker',
                label:'标签颜色',
            }],
            buttons: [{
                value: '保存',
                type: 'primary',
                onClick: [{
                    action: 'confirm',
                    title: '表单保存',
                    message: '是否保存表单?',
                    confirm: [{
                        var:'value',
                        target:'$widget',
                        action:'call',
                        method:'getValue'
                    },{
                        action: 'service',
                        path: 'system/dictionary/config/save',
                        params: {
                            '...':[
                                '$widget.value'
                            ],
                            module:'"system_module"',
                            name: '"contact_label"',               
                        }
                    },{
                        action:'dialog-hide',
                        mode:'apply'
                    }]
                }]
            }],
        }]
    }]
} ;